package com.yowasa.xiuxian.engine.hone.special;

import com.yowasa.xiuxian.annoations.SE;
import com.yowasa.xiuxian.engine.hone.SpecialInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.exception.HandlerException;

@SE(name = "遮天诀",upAbility = 10,needTravel = 3000)
public class ZheTianJue implements SpecialInterface {
    @Override
    public ElementEnum getElement() {
        return null;
    }

    @Override
    public void limit(UserBO user) {
        if (user.getUserConfig().getAbility() < 10) {
            throw new HandlerException("学习/使用遮天诀必须要道行大于10");
        }
    }

    @Override
    public String limitDesc() {
        return "道行大于10";
    }

    @Override
    public String desc() {
        return "修习之后道行-20";
    }

    @Override
    public void effectOnce(UserBO userBO) {
        userBO.getUserConfig().setAbility(userBO.getUserConfig().getAbility() - 20);
    }
}
